<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>继承</title>
</head>
<body>
</body>
    <script>
      //定义类
      class Teacher{
        //构造方法
        constructor(name,course) {
          this.name = name;
          this.course =course;
        }

        work1(){
          document.write("教学生----")
        }
      }


      class Student extends Teacher{
        constructor(name,course,game) {
          super(name,course);
          this.game =game;
        }

        work2(){
          document.write(this.name+this.course+this.game);
        }
      }


      let s =new Student("张三","数学","绝地求生")
      s.work2();
      s.work1();

    </script>
</html>